package operation;

import book.Book;
import book.BookList;

/**
 * Created with IntelliJ IDEA.
 * Description:
 */
public class AddOperation implements IOperation{

    public void work(BookList bookList){
        System.out.println("添加图书");
//        private String name;//书名
//        private String author;//作者
//        private int price;//价格
//        private String type;//类型
        System.out.println("请输入书名：");
        String name = scanner.nextLine();
        System.out.println("请输入作者：");
        String author = scanner.nextLine();
        System.out.println("请输入类型:");
        String type = scanner.nextLine();
        System.out.println("请输入价格:");
        int price = scanner.nextInt();

        Book book = new Book(name,author,price,type);
        bookList.setPos(bookList.getUseSize(),book);
        bookList.setUseSize(bookList.getUseSize()+1);
        System.out.println("添加图书成功");
    }
}
